/*
 www.thomasmueller.ch

 Copyright (C) 2004 Thomas Mueller

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

 */

package ch.thomasmueller.saltyfiles.transformer;

import junit.framework.TestCase;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;

import ch.thomasmueller.saltyfiles.data.AlgoritmesEnum.Algoritmes;

/**
 * @author Thomas Mueller
 *  
 */
public class TransformerTest extends TestCase
{

	private Logger log = LogManager.getLogger(this.getClass().getName());

	public void test() throws Exception
	{
		NewTransformer t;
		t = new NewTransformer("1234567812345678".toCharArray(), new byte[8]);
		assertEquals(t.fixPassword("12345678", Algoritmes.AES), "1234567812345678"); //password to short
		assertEquals(t.fixPassword("1234567812345678123456781234567812345678", Algoritmes.AES), "12345678123456781234567812345678"); //password to long
		assertEquals(t.fixPassword("123456781234567812345678", Algoritmes.AES), "123456781234567812345678"); //password in the middle
		assertEquals(t.fixPassword("1", Algoritmes.Blowfish), "1111");
		assertEquals(t.fixPassword("123456781234567812345678123456781234567812345678123456781234567812345678123456781234567812345678", Algoritmes.Blowfish), "12345678123456781234567812345678123456781234567812345678");
	}
	

	
		
	
	

}